package com.googlecode.gunncs.mechanism.component;

import maze.Node;
import maze.PathSegment;

import com.googlecode.gunncs.mechanism.AbstractBot;

/**
 * Part of the event framework -- <strong>Mechanisms</strong>,
 * <strong>Controls</strong>.
 * 
 * <p>
 * What should we put in this?
 * </p>
 * <p>
 * Should this encapsulate what is currently done via the
 * {@link AbstractBot#fromLast()} and {@link AbstractBot#getCurrent()} methods?
 * </p>
 * 
 * @see AbstractBot
 * @author Calvin, ajc
 */
public class NodeFoundEvent {
	private final PathSegment fromSource;
	private final Node source;

	public NodeFoundEvent(PathSegment fromSource, Node node) {
		this.fromSource = fromSource;
		this.source = node;
	}

	/**
	 * 
	 * @return the last step that was running at the time of this event
	 */
	public PathSegment lastStep() {
		return fromSource;
	}

	/**
	 * 
	 * @return the origin Node, source of the last step that was running at the
	 *         time of this event
	 */
	public Node getSource() {
		return source;
	}
}